﻿<Window x:Class="WPFToolBarExample.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="MainWindow"
        Width="525"
        Height="350">
  <Grid>
    <Grid.RowDefinitions>
      <RowDefinition Height="Auto" />
      <RowDefinition Height="*" />
    </Grid.RowDefinitions>
    <ToolBarTray Grid.Row="0"
                 Background="White"
                 FlowDirection="LeftToRight">
      <ToolBar Band="1" BandIndex="1">
        <Button Margin="2" Command="{Binding NewCourseCommand}">
          <Image Source="Images/Document.png" Stretch="None" />
          <Button.ToolTip>
            <ToolTip Content="Click to add new Course." />
          </Button.ToolTip>
        </Button>
        <Button Margin="2" Command="{Binding NewStudentCommand}">
          <Image Source="Images/Document.png" Stretch="None" />
          <Button.ToolTip>
            <ToolTip Content="Click to add new Student." />
          </Button.ToolTip>
        </Button>
        <Button Margin="2" Command="{Binding OpenNewFileCommand}">
          <Image Source="Images/Folder.png"
                 Stretch="None"
                 ToolTipService.ToolTip="New Folder" />
        </Button>
        <Button Margin="2"
                Command="{Binding SaveCommand}"
                CommandParameter="MyDocument.Txt"
                ToolTipService.ShowOnDisabled="True"
                ToolTipService.ToolTip="Save">
          <Button.Content>
            <Viewbox Width="16" Height="16">
              <Image Stretch="None">
                <Image.Style>
                  <Style TargetType="{x:Type Image}">
                    <Setter Property="Source" Value="Images/Save.png" />
                    <Style.Triggers>
                      <Trigger Property="IsEnabled" Value="False">
                        <Setter Property="Source" Value="Images/SaveDisabled.png" />
                      </Trigger>
                    </Style.Triggers>
                  </Style>
                </Image.Style>
              </Image>
            </Viewbox>
          </Button.Content>
          <Button.ToolTip>
            <ToolTip Content="Click to save Student and Course." />
          </Button.ToolTip>
        </Button>
        <Button Margin="2" Command="{Binding ClearCommand}">
          <Image Source="Images/Delete.png"
                 Stretch="None"
                 ToolTipService.ToolTip="Delete" />
        </Button>
      </ToolBar>
      <ToolBar Width="76"
               HorizontalAlignment="Left"
               VerticalContentAlignment="Stretch"
               Band="2"
               BandIndex="1">

        <Button Margin="2" Command="{Binding PrintCommand}">
          <Image Source="Images/Printer.png"
                 Stretch="None"
                 ToolTipService.ToolTip="Print" />
        </Button>
        <Button Margin="2">
          <Image Source="Images/Status Flag Red.png"
                 Stretch="None"
                 ToolTipService.ToolTip="Status" />
        </Button>
      </ToolBar>

      <ToolBar Band="3" BandIndex="1">
        <Button Margin="2">
          <Image Source="Images/Copy.png"
                 Stretch="None"
                 ToolTipService.ToolTip="Copy" />
        </Button>
        <Button Margin="2">
          <Image Source="Images/Paste.png"
                 Stretch="None"
                 ToolTipService.ToolTip="Paste" />
        </Button>
        <Button Margin="2">
          <Image Source="Images/Cut.png"
                 Stretch="None"
                 ToolTipService.ToolTip="Cut" />
        </Button>

        <Separator />
        <ToggleButton Margin="2">
          <Image Source="Images/Format Font Larger.png" Stretch="None" />
        </ToggleButton>
        <ToggleButton Margin="2">
          <Image Source="Images/Format Stylized Text.png"
                 Stretch="None"
                 ToolTipService.ToolTip="Bold" />
        </ToggleButton>
        <ToggleButton Margin="2">
          <Image Source="Images/Format Underline.png"
                 Stretch="None"
                 ToolTipService.ToolTip="Underline" />
        </ToggleButton>

        <Separator />

        <RadioButton Margin="2" ToolBar.OverflowMode="Always">
          <Image Source="Images/Format Align Left.png"
                 Stretch="None"
                 ToolTipService.ToolTip="Align Left" />
        </RadioButton>
        <RadioButton Margin="2" ToolBar.OverflowMode="Always">
          <Image Source="Images/Format Align Center.png"
                 Stretch="None"
                 ToolTipService.ToolTip="Align Center" />
        </RadioButton>
        <RadioButton Margin="2" ToolBar.OverflowMode="Always">
          <Image Source="Images/Format Align Right.png"
                 Stretch="None"
                 ToolTipService.ToolTip="Align Right" />
        </RadioButton>
      </ToolBar>
    </ToolBarTray>
    <TextBox x:Name="textInput"
             Grid.Row="1"
             MinHeight="140"
             AcceptsReturn="True"
             BorderThickness="0"
             Foreground="#FF767676"
             Text="{Binding DisplayText,
                            UpdateSourceTrigger=PropertyChanged,
                            Mode=TwoWay}" />

  </Grid>
</Window>
